home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / Examples / ReqList_ex.thor < prev    next >
Text File  |  1995-09-06  |  1KB  |  60 lines

  1. /*
  2. **
  3. ** ReqList_Ex.thor  - Example script for the REQUESTLIST function in THOR 2.0
  4. **
  5. */
  6.  
  7. options results
  8.  
  9. if(substr(address(),1,4) ~= "THOR") then do
  10.     parse arg thorport
  11.     if~(show(p, thorport)) then do
  12.         if ~(show(p, "THOR.01")) then do
  13.             say "No THOR port found!"
  14.             exit
  15.         end
  16.         else thorport = "THOR.01"
  17.     end
  18. end
  19. else thorport = address()
  20.  
  21. if ~show('p', 'BBSREAD') then do
  22.     address command
  23.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  24.         "WaitForPort BBSREAD"
  25. end
  26.  
  27. address(BBSREAD)
  28.  
  29. GETBBSLIST stem BBSLIST
  30. if(rc ~= 0) then 
  31. do
  32.     address(thorport)
  33.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  34.     exit
  35. end
  36.  
  37. address(thorport)
  38.  
  39. /* Single select from the BBS list */
  40.  
  41. REQUESTLIST instem BBSLIST title '"Select BBS:"' SIZEGADGET
  42. if(rc = 0) then
  43. do
  44.     sel = 'You selected: '||result
  45.     REQUESTNOTIFY TEXT '"'sel'"'  BT '"_Ok"'
  46. end
  47.  
  48. /* Multi and dragselect from the BBS list, no sizegadget */
  49.  
  50. REQUESTLIST instem BBSLIST outstem SELECTED MULTISELECT DRAGSELECT title '"Select BBSes:"'
  51. if(rc = 0) then
  52. do
  53.     say 'You selected: '||SELECTED.COUNT
  54.     do i=1 to SELECTED.COUNT
  55.         say SELECTED.i
  56.     end
  57. end
  58.  
  59. exit
  60.